﻿namespace Modbus.Messages
{
	internal sealed class SlaveExceptionResponse : ModbusMessage
	{
		private byte exceptionCode;
		
		public override void Read(ModbusReader reader)
		{
			base.Read(reader);

			this.exceptionCode = reader.ReadByte();
		}

		public override void Write(ModbusWriter writer)
		{
			base.Write(writer);

			writer.Write(this.exceptionCode);
		}

		public byte ExceptionCode
		{
			get { return this.exceptionCode; }
			set { this.exceptionCode = value; }
		}
	}
}
